<?php $this->load->view('global_header'); ?>
<link rel="stylesheet" type="text/css" href="/assets/css/photo.css"/>

<div>
    <a href="<?php echo base_url(); ?>admin.php?c=photo&m=create">上传图片</a>
</div>
<?php foreach ($photos as $photo): ?>
        <div class="photo">
            <div class="content">
            <img src="/assets/images/uploads/<?php echo $photo->file_name; ?>" alt="<?php echo $photo->label; ?>"/>
            <div class="label"><?php echo $photo->label; ?></div>
            <div class="time"><?php echo $photo->created_at; ?></div>
            </div>
            <div class="actions">
            <a href="<?php echo base_url(); ?>admin.php?c=photo&m=edit&id=<?php echo $photo->id; ?>">修改</a>
            <a href="<?php echo base_url(); ?>admin.php?c=photo&m=delete&id=<?php echo $photo->id; ?>">删除</a>
    </div>
</div>
<?php endforeach; ?>
        <div class="clear"></div>
        <div class="page_links"><?php echo $page_links; ?></div>
<script type="text/javascript">
    $(function(){
        $(".photo .actions").css({
            "position":"absolute",
            "z-index":100,
            "top":0,
            "left":0
        });
        $(".photo .actions").hide();
        $(".photo").hover(function(){
            $(this).children(".actions").show();
        },function(){
            $(this).children(".actions").hide();
        });
    });
</script>
<?php $this->load->view('global_footer'); ?>